import { App } from 'vue'

import { formatTimestamp, formatUtcString } from '@/utils/format-time'

export default function registerProperties(app: App) {
  // 注册￥filter属性
  app.config.globalProperties.$filter = {
    formatTimeUtc(value: string, format?: string) {
      return formatUtcString(value, format)
    },
    formatTimestamp(value: number, format?: string) {
      return formatTimestamp(value)
    }
  }
}
